
import matplotlib.pyplot as plt
import numpy as np
def plot_f(f,x_range):
    x = np.linspace(x_range[0],x_range[1],101)
    y = f(x)
    plt.figure(figsize=(8,6))
    plt.plot(x,y)
    plt.xlabel("x")
    plt.ylabel("y")
    plt.legend()
    plt.show()
def f(x):
    return x**8-8*x**7+28*x**6-56*x**5+70*x**4-56*x**3+28*x**2-8*x+1
def g(x):
    return (((((((x-8)*x+28)*x-56)*x+70)*x-56)*x+28)*x-8)*x+1
def h(x):
    return (x-1)**8
#plot_f(f,[0.99, 1.01])
#plot_f(g,[0.99, 1.01])
plot_f(h,[0.99, 1.01])